package com.orange.wwwapi.controller.banner;


import com.orange.core.pojo.R;
import com.orange.core.pojo.entity.banner.vo.BannerVO;
import com.orange.core.service.banner.BannerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>ClassName:BannerController</p>
 * <p>Description: banner管理Controller</p>
 * <p>Author: lwm</p>
 * <p>Date: 2025/6/2 23:35</p>
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/banner")
public class BannerController {

    private final BannerService bannerService;

    /**
     * 获取banner列表
     * @return
     */
    @GetMapping("/list")
    public R<List<BannerVO>> getBannerList(){
        return R.ok(bannerService.getBannerList());
    }

    /**
     * banner管理详情
     * @param id
     * @return
     */
    @GetMapping("/info/{id}")
    public R<BannerVO> info(@PathVariable("id")Integer id){
        return R.ok(bannerService.info(id));
    }
}
